﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Reflection;
using System.Xml;
using System.Xml.Schema;

namespace LinqToBing.Bing.Wrapper.Search
{
    public class SearchResult : SearchResultBase
    {
        public SearchResult()
        {
        }

        public SearchResult(XDocument xdoc)
        {
            bool IsValidDocument = true;

            // check if valid xdocument...


            if (IsValidDocument)
            {
                XDocument = xdoc;
                //ParseDocument(XDocument);
            }
        }
        
        public override void ParseDocument(XDocument xdoc)
        {
            Type thisType = this.GetType();
            MethodInfo mi = thisType.GetMethod("ParseDocument");
            mi.Invoke(this, new object[] { xdoc });
        }
    }
}
